package cn.mrlong.tools.view

import com.intellij.ui.JBColor
import javax.swing.JScrollPane
import javax.swing.JTextArea

fun JScrollPane.setLineNumberView(textArea: JTextArea) {
    verticalScrollBar.value = (0)
    textArea.setLineWrap(true);        //激活自动换行功能
    textArea.setWrapStyleWord(true);
    val line = LineNumberHeaderView()
    line.lineHeight = textArea.getFontMetrics(textArea.font)!!.height
    line.font = textArea.font
    line.foreground = JBColor.GRAY
    setRowHeaderView(line)
}